<!DOCTYPE html>
<html>

<head>
  <title>Quarkus - Using AMQP with Reactive Messaging</title>
  <script id="adobe_dtm" src="https://www.redhat.com/dtm.js" type="text/javascript"></script>
  <script src="/assets/javascript/highlight.pack.js" type="text/javascript"></script>
  <META HTTP-EQUIV='Content-Security-Policy' CONTENT="default-src 'none'; script-src 'self' 'unsafe-eval' 'sha256-ANpuoVzuSex6VhqpYgsG25OHWVA1I+F6aGU04LoI+5s=' 'sha256-ipy9P/3rZZW06mTLAR0EnXvxSNcnfSDPLDuh3kzbB1w=' js.bizographics.com https://www.redhat.com assets.adobedtm.com jsonip.com https://ajax.googleapis.com https://www.googletagmanager.com https://www.google-analytics.com https://use.fontawesome.com; style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com; img-src 'self' *; media-src 'self' ; frame-src https://www.googletagmanager.com https://www.youtube.com; frame-ancestors 'none'; base-uri 'none'; object-src 'none'; form-action 'none'; font-src 'self' https://use.fontawesome.com https://fonts.gstatic.com;">
  <META HTTP-EQUIV='X-Frame-Options' CONTENT="DENY">
  <META HTTP-EQUIV='X-XSS-Protection' CONTENT="1; mode=block">
  <META HTTP-EQUIV='X-Content-Type-Options' CONTENT="nosniff">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Quarkus: Supersonic Subatomic Java">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@QuarkusIO"> 
  <meta name="twitter:creator" content="@QuarkusIO">
  <meta property="og:url" content="https://quarkus.io/guides/amqp" />
  <meta property="og:title" content="Quarkus - Using AMQP with Reactive Messaging" />
  <meta property="og:description" content="Quarkus: Supersonic Subatomic Java" />
  <meta property="og:image" content="/assets/images/quarkus_card.png" />
  <link rel="canonical" href="https://quarkus.io/guides/amqp">
  <link rel="shortcut icon" type="image/png" href="/favicon.ico" >
  <link rel="stylesheet" href="https://quarkus.io/guides/stylesheet/config.css" />
  <link rel="stylesheet" href="/assets/css/main.css" />
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <link rel="alternate" type="application/rss+xml"  href="https://quarkus.io/feed.xml" title="Quarkus">
  <script src="https://quarkus.io/assets/javascript/goan.js" type="text/javascript"></script>
  <script src="https://quarkus.io/assets/javascript/hl.js" type="text/javascript"></script>
</head>

<body class="guides">
  <!-- Google Tag Manager (noscript) -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NJWS5L"
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <!-- End Google Tag Manager (noscript) -->

  <div class="nav-wrapper">
  <div class="grid-wrapper">
    <div class="width-12-12">
      <input type="checkbox" id="checkbox" />
      <nav id="main-nav" class="main-nav">
  <div class="container">
    <div class="logo-wrapper">
      
        <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_600px_reverse.png" class="project-logo" title="Quarkus"></a>
      
    </div>
    <label class="nav-toggle" for="checkbox">
      <i class="fa fa-bars"></i>
    </label>
    <div id="menu" class="menu">
      <span>
        <a href="/get-started/" class="">Get Started</a>
      </span>
      <span>
        <a href="/guides/" class="active">Guides</a>
      </span>
      <span>
        <a href="/community/" class="">Community</a>
      </span>
      <span>
        <a href="/support/" class="">Support</a>
      </span>
      <span>
        <a href="/blog/" class="">Blog</a>
      </span>
      <span>
        <a href="https://code.quarkus.io" class="button-cta secondary white">Start Coding</a>
      </span>
    </div>
  </div>
      </nav>
    </div>
  </div>
</div>

  <div class="content">
    <div class="guide">
  <div class="width-12-12">
    <h1 class="text-caps">Quarkus - Using AMQP with Reactive Messaging</h1>
    <div class="hide-mobile toc"><ul class="sectlevel1">
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#architecture">Architecture</a></li>
<li><a href="#solution">Solution</a></li>
<li><a href="#creating-the-maven-project">Creating the Maven Project</a></li>
<li><a href="#starting-an-amqp-broker">Starting an AMQP broker</a></li>
<li><a href="#the-price-generator">The price generator</a></li>
<li><a href="#the-price-converter">The price converter</a></li>
<li><a href="#the-price-resource">The price resource</a></li>
<li><a href="#configuring-the-amqp-connector">Configuring the AMQP connector</a></li>
<li><a href="#the-html-page">The HTML page</a></li>
<li><a href="#get-it-running">Get it running</a></li>
<li><a href="#running-native">Running Native</a></li>
<li><a href="#imperative-usage">Imperative usage</a></li>
<li><a href="#going-further">Going further</a></li>
</ul></div>
    <div>
      <div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This guide demonstrates how your Quarkus application can utilize MicroProfile Reactive Messaging to interact with AMQP.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="paragraph">
<p>This technology is considered preview.</p>
</div>
<div class="paragraph">
<p>In <em>preview</em>, backward compatibility and presence in the ecosystem is not guaranteed.
Specific improvements might require to change configuration or APIs and plans to become <em>stable</em> are under way.
Feedback is welcome on our <a href="https://groups.google.com/d/forum/quarkus-dev">mailing list</a> or as issues in our <a href="https://github.com/quarkusio/quarkus/issues">GitHub issue tracker</a>.</p>
</div>
<div class="paragraph">
<p>For a full list of possible extension statuses, check our <a href="https://quarkus.io/faq/#extension-status">FAQ entry</a>.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="prerequisites"><a class="anchor" href="#prerequisites"></a>Prerequisites</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To complete this guide, you need:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>less than 15 minutes</p>
</li>
<li>
<p>an IDE</p>
</li>
<li>
<p>JDK 1.8+ installed with <code>JAVA_HOME</code> configured appropriately</p>
</li>
<li>
<p>Apache Maven 3.6.2+</p>
</li>
<li>
<p>A running AMQP 1.0 broker, or Docker Compose to start a development cluster</p>
</li>
<li>
<p>GraalVM installed if you want to run in native mode.</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="architecture"><a class="anchor" href="#architecture"></a>Architecture</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In this guide, we are going to generate (random) prices in one component.
These prices are written in an AMQP queue (<code>prices</code>).
A second component reads from the <code>prices</code> queue and apply some magic conversion to the price.
The result is sent to an in-memory stream consumed by a JAX-RS resource.
The data is sent to a browser using server-sent events.</p>
</div>
<div class="imageblock">
<div class="content">
<img src="/guides/images/amqp-guide-architecture.png" alt="Architecture">
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="solution"><a class="anchor" href="#solution"></a>Solution</h2>
<div class="sectionbody">
<div class="paragraph">
<p>We recommend that you follow the instructions in the next sections and create the application step by step.
However, you can go right to the completed example.</p>
</div>
<div class="paragraph">
<p>Clone the Git repository: <code>git clone <a href="https://github.com/quarkusio/quarkus-quickstarts.git" class="bare">https://github.com/quarkusio/quarkus-quickstarts.git</a></code>, or download an <a href="https://github.com/quarkusio/quarkus-quickstarts/archive/master.zip">archive</a>.</p>
</div>
<div class="paragraph">
<p>The solution is located in the <code>amqp-quickstart</code> <a href="https://github.com/quarkusio/quarkus-quickstarts/tree/master/amqp-quickstart">directory</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="creating-the-maven-project"><a class="anchor" href="#creating-the-maven-project"></a>Creating the Maven Project</h2>
<div class="sectionbody">
<div class="paragraph">
<p>First, we need a new project. Create a new project with the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">mvn io.quarkus:quarkus-maven-plugin:1.7.0.Final:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=amqp-quickstart \
    -Dextensions="amqp"
cd amqp-quickstart</code></pre>
</div>
</div>
<div class="paragraph">
<p>This command generates a Maven project, importing the Reactive Messaging and AMQP connector extensions.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="starting-an-amqp-broker"><a class="anchor" href="#starting-an-amqp-broker"></a>Starting an AMQP broker</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Then, we need an AMQP broker.
You can follow the instructions from the <a href="https://activemq.apache.org/components/artemis/">Apache Artemis web site</a> or create a <code>docker-compose.yaml</code> file with the following content:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="yaml" class="language-yaml hljs"># A docker compose file to start an Artemis AMQP broker
# more details on https://github.com/vromero/activemq-artemis-docker.
version: '2'

services:

  artemis:
    image: vromero/activemq-artemis:2.8.0-alpine
    ports:
      - "8161:8161"
      - "61616:61616"
      - "5672:5672"
    environment:
      ARTEMIS_USERNAME: quarkus
      ARTEMIS_PASSWORD: quarkus</code></pre>
</div>
</div>
<div class="paragraph">
<p>Once created, run <code>docker-compose up</code>.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
This is a development cluster, do not use in production.
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="the-price-generator"><a class="anchor" href="#the-price-generator"></a>The price generator</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Create the <code>src/main/java/org/acme/amqp/PriceGenerator.java</code> file, with the following content:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.amqp;

import io.reactivex.Flowable;
import org.eclipse.microprofile.reactive.messaging.Outgoing;

import javax.enterprise.context.ApplicationScoped;
import java.util.Random;
import java.util.concurrent.TimeUnit;

/**
 * A bean producing random prices every 5 seconds.
 * The prices are written to an AMQP queue (prices). The AMQP configuration is specified in the
 * application configuration.
 */
@ApplicationScoped
public class PriceGenerator {

    private Random random = new Random();

    @Outgoing("generated-price")                        <i class="conum" data-value="1"></i><b>(1)</b>
    public Flowable&lt;Integer&gt; generate() {               <i class="conum" data-value="2"></i><b>(2)</b>
        return Flowable.interval(5, TimeUnit.SECONDS)
                .map(tick -&gt; random.nextInt(100));
    }

}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Instruct Reactive Messaging to dispatch the items from returned stream to <code>generated-price</code>.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>The method returns a RX Java 2 <em>stream</em> (<code>Flowable</code>) emitting a random <em>price</em> every 5 seconds.</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The method returns a <em>Reactive Stream</em>. The generated items are sent to the stream named <code>generated-price</code>.
This stream is mapped to an AMQP queue using the <code>application.properties</code> file that we will create soon.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="the-price-converter"><a class="anchor" href="#the-price-converter"></a>The price converter</h2>
<div class="sectionbody">
<div class="paragraph">
<p>The price converter reads the prices from AMQP, and transforms them.
Create the <code>src/main/java/org/acme/amqp/PriceConverter.java</code> file with the following content:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.amqp;

import io.smallrye.reactive.messaging.annotations.Broadcast;
import org.eclipse.microprofile.reactive.messaging.Incoming;
import org.eclipse.microprofile.reactive.messaging.Outgoing;

import javax.enterprise.context.ApplicationScoped;

/**
 * A bean consuming data from the "prices" AMQP queue and applying some conversion.
 * The result is pushed to the "my-data-stream" stream which is an in-memory stream.
 */
@ApplicationScoped
public class PriceConverter {

    private static final double CONVERSION_RATE = 0.88;

    @Incoming("prices")                                  <i class="conum" data-value="1"></i><b>(1)</b>
    @Outgoing("my-data-stream")                          <i class="conum" data-value="2"></i><b>(2)</b>
    @Broadcast                                           <i class="conum" data-value="3"></i><b>(3)</b>
    public double process(int priceInUsd) {
        return priceInUsd * CONVERSION_RATE;
    }

}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Indicates that the method consumes the items from the <code>prices</code> channel</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Indicates that the objects returned by the method are sent to the <code>my-data-stream</code> channel</td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Indicates that the item are dispatched to all <em>subscribers</em></td>
</tr>
</table>
</div>
<div class="paragraph">
<p>The <code>process</code> method is called for every AMQP messages from the <code>prices</code> queue (configured in the application configuration).
Every result is sent to the <code>my-data-stream</code> in-memory stream.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="the-price-resource"><a class="anchor" href="#the-price-resource"></a>The price resource</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Finally, let&#8217;s bind our stream to a JAX-RS resource.
Creates the <code>src/main/java/org/acme/amqp/PriceResource.java</code> file with the following content:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.amqp;

import io.smallrye.reactive.messaging.annotations.Channel;
import org.reactivestreams.Publisher;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/**
 * A simple resource retrieving the "in-memory" "my-data-stream" and sending the items as server-sent events.
 */
@Path("/prices")
public class PriceResource {

    @Inject
    @Channel("my-data-stream") Publisher&lt;Double&gt; prices;         <i class="conum" data-value="1"></i><b>(1)</b>

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "hello";
    }


    @GET
    @Path("/stream")
    @Produces(MediaType.SERVER_SENT_EVENTS)                     <i class="conum" data-value="2"></i><b>(2)</b>
    public Publisher&lt;Double&gt; stream() {                         <i class="conum" data-value="3"></i><b>(3)</b>
        return prices;
    }
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>Injects the <code>my-data-stream</code> channel using the <code>@Channel</code> qualifier</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>Indicates that the content is sent using <code>Server Sent Events</code></td>
</tr>
<tr>
<td><i class="conum" data-value="3"></i><b>3</b></td>
<td>Returns the stream (<em>Reactive Stream</em>)</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="configuring-the-amqp-connector"><a class="anchor" href="#configuring-the-amqp-connector"></a>Configuring the AMQP connector</h2>
<div class="sectionbody">
<div class="paragraph">
<p>We need to configure the AMQP connector. This is done in the <code>application.properties</code> file.
The keys are structured as follows:</p>
</div>
<div class="paragraph">
<p><code>mp.messaging.[outgoing|incoming].{channel-name}.property=value</code></p>
</div>
<div class="paragraph">
<p>The <code>channel-name</code> segment must match the value set in the <code>@Incoming</code> and <code>@Outgoing</code> annotation:
* <code>generated-price</code> &#8594; sink in which we write the prices
* <code>prices</code> &#8594; source in which we read the prices</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs"># Configures the AMQP broker credentials.
amqp-username=quarkus
amqp-password=quarkus

# Configure the AMQP connector to write to the `prices` address
mp.messaging.outgoing.generated-price.connector=smallrye-amqp
mp.messaging.outgoing.generated-price.address=prices

# Configure the AMQP connector to read from the `prices` queue
mp.messaging.incoming.prices.connector=smallrye-amqp
mp.messaging.incoming.prices.durable=true</code></pre>
</div>
</div>
<div class="paragraph">
<p>More details about this configuration is available in the <a href="https://smallrye.io/smallrye-reactive-messaging/#_interacting_using_amqp">SmallRye Reactive Messaging AMQP connector</a> documentation.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
What about <code>my-data-stream</code>? This is an in-memory stream, not connected to a message broker.
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="the-html-page"><a class="anchor" href="#the-html-page"></a>The HTML page</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Final touch, the HTML page reading the converted prices using SSE.</p>
</div>
<div class="paragraph">
<p>Create the <code>src/main/resources/META-INF/resources/prices.html</code> file, with the following content:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="html" class="language-html hljs">&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
    &lt;meta charset="UTF-8"&gt;
    &lt;title&gt;Prices&lt;/title&gt;

    &lt;link rel="stylesheet" type="text/css"
          href="https://cdnjs.cloudflare.com/ajax/libs/patternfly/3.24.0/css/patternfly.min.css"&gt;
    &lt;link rel="stylesheet" type="text/css"
          href="https://cdnjs.cloudflare.com/ajax/libs/patternfly/3.24.0/css/patternfly-additions.min.css"&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="container"&gt;

    &lt;h2&gt;Last price&lt;/h2&gt;
    &lt;div class="row"&gt;
    &lt;p class="col-md-12"&gt;The last price is &lt;strong&gt;&lt;span id="content"&gt;N/A&lt;/span&gt;&amp;nbsp;&amp;euro;&lt;/strong&gt;.&lt;/p&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;script src="https://code.jquery.com/jquery-3.3.1.min.js"&gt;&lt;/script&gt;
&lt;script&gt;
    var source = new EventSource("/prices/stream");
    source.onmessage = function (event) {
        document.getElementById("content").innerHTML = event.data;
    };
&lt;/script&gt;
&lt;/html&gt;</code></pre>
</div>
</div>
<div class="paragraph">
<p>Nothing spectacular here. On each received price, it updates the page.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="get-it-running"><a class="anchor" href="#get-it-running"></a>Get it running</h2>
<div class="sectionbody">
<div class="paragraph">
<p>If you followed the instructions, you should have the AMQP broker running.
Then, you just need to run the application using:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">./mvnw quarkus:dev</code></pre>
</div>
</div>
<div class="paragraph">
<p>Open <code><a href="http://localhost:8080/prices.html" class="bare">http://localhost:8080/prices.html</a></code> in your browser.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you started the AMQP broker with docker compose, stop it using <code>CTRL+C</code> followed by <code>docker-compose down</code>.
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="running-native"><a class="anchor" href="#running-native"></a>Running Native</h2>
<div class="sectionbody">
<div class="paragraph">
<p>You can build the native executable with:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="shell" class="language-shell hljs">./mvnw package -Pnative</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="imperative-usage"><a class="anchor" href="#imperative-usage"></a>Imperative usage</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Sometimes you need to have an imperative way of sending messages.</p>
</div>
<div class="paragraph">
<p>For example, if you need to send a message to a stream from inside a REST endpoint when receiving a POST request.
In this case, you cannot use <code>@Outgoing</code> because your method has parameters.</p>
</div>
<div class="paragraph">
<p>For this, you can use an <code>Emitter</code>.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">import org.eclipse.microprofile.reactive.messaging.Channel;
import org.eclipse.microprofile.reactive.messaging.Emitter;

import javax.inject.Inject;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Consumes;
import javax.ws.rs.core.MediaType;

@Path("/prices")
public class PriceResource {

    @Inject @Channel("price-create") Emitter&lt;Double&gt; priceEmitter;

    @POST
    @Consumes(MediaType.TEXT_PLAIN)
    public void addPrice(Double price) {
        priceEmitter.send(price);
    }
}</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
The <code>Emitter</code> configuration is done the same way as the other stream configuration used by <code>@Incoming</code> and <code>@Outgoing</code>.
In addition, you can use <code>@OnOverflow</code> to configure a back-pressure strategy.
</td>
</tr>
</table>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
<div class="title">Deprecation</div>
<div class="paragraph">
<p>The <code>io.smallrye.reactive.messaging.annotations.Emitter</code>, <code>io.smallrye.reactive.messaging.annotations.Channel</code> and <code>io.smallrye.reactive.messaging.annotations.OnOverflow</code> classes are now deprecated and replaced by:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>org.eclipse.microprofile.reactive.messaging.Emitter</code></p>
</li>
<li>
<p><code>org.eclipse.microprofile.reactive.messaging.Channel</code></p>
</li>
<li>
<p><code>org.eclipse.microprofile.reactive.messaging.OnOverflow</code></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The new <code>Emitter.send</code> method returns a <code>CompletionStage</code> completed when the produced message is acknowledged.</p>
</div>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="sect1">
<h2 id="going-further"><a class="anchor" href="#going-further"></a>Going further</h2>
<div class="sectionbody">
<div class="paragraph">
<p>This guide has shown how you can interact with AMQP using Quarkus.
It utilizes MicroProfile Reactive Messaging to build data streaming applications.</p>
</div>
<div class="paragraph">
<p>If you did the Kafka quickstart, you have realized that it&#8217;s the same code.
The only difference is the connector configuration.</p>
</div>
<div class="paragraph">
<p>If you want to go further check the documentation of <a href="https://smallrye.io/smallrye-reactive-messaging">SmallRye Reactive Messaging</a>, the implementation used in Quarkus.</p>
</div>
</div>
</div>
    </div>
  </div>
</div>

  </div>

  <div class="content project-footer">
  <div class="footer-section">
    <div class="logo-wrapper">
      <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_reverse.svg" class="project-logo" title="Quarkus"></a>
    </div>
  </div>
  <div class="grid-wrapper">
    <p class="grid__item width-3-12">Quarkus is open. All dependencies of this project are available under the <a href='https://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache Software License 2.0</a> or compatible license.<br /><br />This website was built with <a href='https://jekyllrb.com/' target='_blank'>Jekyll</a>, is hosted on <a href='https://pages.github.com/' target='_blank'>Github Pages</a> and is completely open source. If you want to make it better, <a href='https://github.com/quarkusio/quarkusio.github.io' target='_blank'>fork the website</a> and show us what you’ve got.</p>

    
      <div class="width-1-12 project-links">
        <span>Navigation</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="/">Home</a></li>
          
            <li><a href="/guides">Guides</a></li>
          
            <li><a href="/community/#contributing">Contribute</a></li>
          
            <li><a href="/faq">FAQ</a></li>
          
            <li><a href="/get-started">Get Started</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Contribute</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://twitter.com/quarkusio">Follow us</a></li>
          
            <li><a href="https://github.com/quarkusio">GitHub</a></li>
          
            <li><a href="/security">Security&nbsp;policy</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Get Help</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://groups.google.com/forum/#!forum/quarkus-dev">Forums</a></li>
          
            <li><a href="https://quarkusio.zulipchat.com">Chatroom</a></li>
          
        </ul>
      </div>
    

    
      <div class="width-3-12 more-links">
        <span>Quarkus is made of community projects</span>
        <ul class="footer-links">
          
            <li><a href="https://vertx.io/" target="_blank">Eclipse Vert.x</a></li>
          
            <li><a href="https://microprofile.io" target="_blank">Eclipse MicroProfile</a></li>
          
            <li><a href="https://hibernate.org" target="_blank">Hibernate</a></li>
          
            <li><a href="https://netty.io" target="_blank">Netty</a></li>
          
            <li><a href="https://resteasy.github.io" target="_blank">RESTEasy</a></li>
          
            <li><a href="https://camel.apache.org" target="_blank">Apache Camel</a></li>
          
            <li><a href="https://code.quarkus.io/" target="_blank">And many more...</a></li>
          
        </ul>
      </div>
    
  </div>
</div>
  <div class="content redhat-footer">
  <div class="grid-wrapper">
    <span class="licence">
      <i class="fab fa-creative-commons"></i><i class="fab fa-creative-commons-by"></i> <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC by 3.0</a> | <a href="https://www.redhat.com/en/about/privacy-policy">Privacy Policy</a>
    </span>
    <span class="redhat">
      Sponsored by
    </span>
    <span class="redhat-logo">
      <a href="https://www.redhat.com/" target="_blank"><img src="/assets/images/redhat_reversed.svg"></a>
    </span>
  </div>
</div>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script>
  <script type="text/javascript" src="/assets/javascript/mobile-nav.js"></script>
  <script type="text/javascript" src="/assets/javascript/scroll-down.js"></script>
  <script src="/assets/javascript/satellite.js" type="text/javascript"></script>
  <script src="https://quarkus.io/guides/javascript/config.js" type="text/javascript"></script>
  <script src="/assets/javascript/search-filter.js" type="text/javascript"></script>
  <script src="/assets/javascript/back-to-top.js" type="text/javascript"></script>
</body>

</html>
